<?php

namespace app\common\model\xiservice;

use think\Model;


class Timelist extends Model
{

    

    

    // 表名
    protected $name = 'xiservice_timelist';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'start_time_text'
    ];
    

      public function getStartTimeTextAttr($value, $data)
    {
        $start_time = isset($data['start_time']) ? $data['start_time'] : '';
        $end_time = isset($data['end_time']) ? $data['end_time'] : '';
        $stime =  date("H:i",strtotime(date('Y-m-d',time())." ".$start_time));
        $etime =  date("H:i",strtotime(date('Y-m-d',time())." ".$end_time));
        return  $stime.'-'.$etime;
    }
  







}
